<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <ul>
      <li>1</li>
      <li class="l1">2</li>
      <li>3</li>
      <li class="l1">4</li>
    </ul>
    <div id="box">hello box</div>
    <script>
      const box = document.getElementById("box");
      // const box = document.querySelector("#box");
      // const box = document.querySelectorAll("#box")[0];

      console.log(box.matches("body div")); //true
      console.log(box.matches("#box")); //true
      console.log(box.matches("#box1")); //fasle
      console.log(box.matches("ul li ")); //fasle
    </script>
  </body>
</html>
